package com.seleniti.enpareja.controller.ui.main;

import org.ioc.commons.flowcontrol.actioncontroller.IsExternalAction;
import org.ioc.commons.flowcontrol.eventbus.IsEvent;
import org.ioc.commons.flowcontrol.operationmanager.IsOperation;
import org.ioc.commons.ui.HasLoader;
import org.ioc.commons.ui.HasPendingOperationsLoader;
import org.ioc.commons.ui.HasText;
import org.ioc.commons.ui.HasValue;
import org.ioc.commons.ui.HasVisibility;
import org.ioc.commons.ui.IsDisplay;
import org.ioc.commons.ui.IsPresenter;

import com.seleniti.enpareja.controller.common.domain.LoggedUserInfo;
import com.seleniti.enpareja.controller.ui.widget.SliderPanel;

public interface AppShell extends IsDisplay<AppShell.Event, AppShell.Operation, AppShell.Action> {
	@interface Fires {
		AppShell.Event[] value();
	}

	@interface Invokes {
		AppShell.Action[] value();
	}

	@interface Performs {
		AppShell.Operation[] value();
	}

	public enum Event implements IsEvent {
	}

	public enum Operation implements IsOperation {
		LoggingOut, MakingCouple
	}

	public enum Action implements IsExternalAction {
		DeleteNow, RefreshNow, SwitchElementsNow, LoadBasics
	}

	public interface Presenter extends IsPresenter {

		boolean onGoBack();

		void onLogout();

		void onOpenSelenitiWebSite();

		void onOpenIocCommonsWebSite();

		void onGoToCoupleRequestsView();

		void onDeleteNow();

		void onRefreshNow();

		void onOpenUserSettings();

		void onGoToGettingStartedView();

		void onGoToGetCoupleView();

		void onSwitchElementsNow();

		void onAuthFailure();

		void onOpenAdminConsole();

		void onOpenWebSiteVersion();

		void onOpenAppSettings();

		boolean onGoBackPressed();

		void onMakeSingle();

		void onMakeTestCouple();

		void onLoadBasics();

	}

	SliderPanel mainContainer();

	HasValue<LoggedUserInfo> loggedUserInfo();

	/**
	 * Open an url link.
	 * 
	 * @param url
	 *            of the link.
	 * @param asExternal
	 *            true if the url will be opened out of the shell, (it will not
	 *            replace current shell content) ; false if it is open inside
	 *            the shell (it will replace current shell content).
	 */
	void openLink(String url, boolean asExternal);

	HasPendingOperationsLoader globalLoader();

	HasVisibility goBackButtonVisible();

	void logout();

	void openSelenitiWebSite();

	HasVisibility nonAssociatedPanelVisibility();

	HasVisibility deleteButtonVisibility();

	HasVisibility refreshButtonVisibility();

	void openSettings();

	HasVisibility gettingStartedInfoVisible();

	HasVisibility requestsToYouPanelVisibility();
	
	HasVisibility pendingRequestsFromYouPanelVisibility();

	HasVisibility rejectedRequestsFromYouPanelVisibility();

	HasVisibility switchButtonVisibility();

	HasVisibility select2InfoVisibility();

	void openAdminConsole();

	void goToMarketPlace();

	HasVisibility retryButtonVisibility();

	HasVisibility firstStepsVisibility();

	HasVisibility nonAssociatedButtonVisibility();

	void makeSingle();

	void makeTestCouple();

	void refreshNow();

	HasLoader makingCoupleIndicator();

	HasVisibility loadBasicsButtonVisibility();

	HasText loadBasicsButtonText();
}
